var orderid=sessionStorage.getItem("orderid");
var zt=sessionStorage.getItem("zt");


					if(zt=="买家已付款"){
						setInterval(daihuodjs,1000);
					}else if(zt=="等待买家付款"){
						setInterval(parorderdjs,1000);
					}
					
					
                function parorderdjs(){
						
							$.ajax({
											url: "http://localhost:16111/orderform/djs",
											Type: "get",
											dataType: "text",
											data:{orderid:orderid},
											xhrFields:{withCredentials: true},
											success:function(date){
												var str="";	
												
													
													var dq= +new Date();
													var ks= +new Date(date);
													var js=ks+43200000;
													
													
													var sy;	
													if(dq<js){
														var sy=(js-dq)/1000;
														var shi= parseInt(sy/60/60%24);
														var fen= parseInt(sy/60%60);
														var miao=parseInt(sy%60);
														var sj="您还有"+shi+":"+fen+":"+miao+"来付款;超时订单将自动关闭";
														str="<span>"+sj+"</span>"
													}
													else if(dq>js){
														gb();
													}
													var a=document.getElementById("d1");
													a.innerHTML=str;
							
											}
										
									});
			}
			
			function gb(){
				$.ajax({
					url: "http://localhost:16111/orderform/gb",
					Type: "get",
					dataType: "text",
					data:{orderid:orderid},
					xhrFields:{withCredentials: true},
				})
			}
			
			
			
			function daihuodjs(){
									$.ajax({
													url: "http://localhost:16111/orderform/daihuodjs",
													Type: "get",
													dataType: "text",
													data:{orderid:orderid},
													xhrFields:{withCredentials: true},
													success:function(date){
														
														var str="";	
														
															;
															var dq= +new Date();
															var ks= +new Date(date);
															var js=ks+43200000;
															
															var sy;	
															if(dq<js){
																var sy=(js-dq)/1000;
																var shi= parseInt(sy/60/60%24);
																var fen= parseInt(sy/60%60);
																var miao=parseInt(sy%60);
																var sj="您还有"+shi+":"+fen+":"+miao+"来付款;超时订单将自动发货";
																str="<span>"+sj+"</span>"
																console.log(sy--);
															}
															else if(dq>js){
																daihuogai();
															}
															
															
															var a=document.getElementById("d1");
															a.innerHTML=str;
									
													}
												
											});
					}
					
					
					function daihuogai(){
						$.ajax({
							url: "http://localhost:16111/orderform/daihuogai",
							Type: "get",
							dataType: "text",
							data:{orderid:orderid},
							xhrFields:{withCredentials: true},
						})
					}